/**
 * 
 */
package com.bot.mapper;

import java.util.List;

import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import com.bot.pojo.Area;
import com.bot.pojo.Major;
import com.bot.pojo.Student;
import com.github.pagehelper.PageInfo;

/**
 * @author zhaoyan
 *
 * 2020年2月4日
 */
public interface MajorMapper {

	/**
	 * @param pageNum
	 * @param student
	 * @return
	 */
	List<Student> findStu(Student student);

	/**
	 * @return
	 */
	@Select("SELECT * FROM major")
	List<Major> findMaj();

	/**
	 * @param student
	 * @return
	 */
	Integer addStu(Student student);

	/**
	 * @param student
	 */
	Integer addMajS(Student student);

	/**
	 * @param id
	 * @return
	 */
	@Select("SELECT * FROM maj_student WHERE id = #{value}")
	Student findById(Integer id);

	/**
	 * @param id
	 * @return
	 */
	@Select("SELECT mid FROM stu_maj WHERE sid = #{value}")
	List<Integer> findMajById(Integer id);

	/**
	 * @param student
	 * @return
	 */
	@Update("UPDATE maj_student SET name = #{name},created = #{created} WHERE id = #{id}")
	Integer update(Student student);
	
	
	@Delete("DELETE FROM stu_maj WHERE sid = #{id}")
	Integer deleteMajStu(Integer id);

	/**
	 * @param ids
	 * @return
	 */
	Integer delStu(List<Integer> ids);

	/**
	 * @param pid
	 * @return
	 */
	List<Area> findAreaList(Integer pid);
	

}
